<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    //首先获取DOM对象
    vat = audio = document.getElementById('audio');

    audio.addEventListener("canplay", function(){
        //在canpaly事件中,可以获取音频时长
        console.log(audio.duration)
    });
    audio.addEventListener("loadstart", function(){
        console.log("事件 loadstart: " + (new Data()).getTime());
    });
    audio.addEventListener("durationchange", function(){
        console.log("事件 : durationchange" + (new Data()).getTime());
    });
    audio.addEventListener("loadedmetadata", function(){
        console.log("事件 :loadedmetadata"+ (new Data()).getTime());
    });
    audio.addEventListener("progress", function(){
        console.log("事件 progress: " + (new Data()).getTime());
    });
    audio.addEventListener("", function(){
        console.log("事件 loadstart: " + (new Data()).getTime());
    });
    audio.addeventlistener("loadstart", function(){
        console.log("事件 loadstart: " + (new Data()).getTime());
    });
    audio.addeventlistener("loadstart", function(){
        console.log("事件 loadstart: " + (new Data()).getTime());
    });
    </script>
</body>
</html>